package com.beans.factory;

import com.core.io.Resource;

public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccessor
        implements BeanDefinition {

    private volatile Object beanClass;

    private Resource resource;

    private String factoryMethodName;

    private String scope = "";

    @Override
    public boolean isSingleton() {
        return SCOPE_SINGLETON.equals(this.scope) || "".equals(this.scope);
    }

    @Override
    public boolean isPrototype() {
        return SCOPE_PROTOTYPE.equals(this.scope);
    }

    @Override
    public void setBeanClassName(String beanClassName) {
        this.beanClass = beanClassName;
    }

    @Override
    public void setScope(String scope) {
        this.scope = scope;
    }

    @Override
    public void setFactoryMethodName(String factoryMethodName) {
        this.factoryMethodName = factoryMethodName;
    }

    public void setResource(Resource resource) {
        this.resource = resource;
    }

    public void setBeanClass(Class<?> beanClass) {
        this.beanClass = beanClass;
    }
}
